<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>利用背景定位实现逐帧动画</title>
    <style>
        div {
            width: 140px;
            height: 140px;
            box-sizing: border-box;
            border: 1px solid black;
            background: url(test.png);
            animation: run 1.5s steps(12) infinite;
        }

        @keyframes run {
            100% {
                background-position: -1680px 0;
            }

        }
    </style>
</head>

<body>
    <div class="main"></div>
    <script>
        /**
         * @param {number} N
         * @return {boolean}
         */
        var divisorGame = function (N) {
            return get_num(N, false)

            function get_num(N, flag) {
                if (N < 2) return flag
                let x = 1
                while (N > x) {
                    if (N % x === 0) {
                        return get_num(N - x, !flag)
                    } else {
                        x++
                    }
                }
            }
        }
    </script>
</body>

</html>